package cn.gene.timeyan.article.webapi.mapper;

import cn.gene.timeyan.pojo.article.model.Comment;
import cn.gene.timeyan.pojo.article.vo.CommentVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 鏂囩珷璇勮?淇℃伅 Mapper 接口
 * </p>
 *
 * @author LWG
 * @since 2022-07-25
 */
@Repository
public interface CommentMapper extends BaseMapper<Comment> {

    int addNewComment(Comment comment);

    List<CommentVO> listByArticleIdLike(Long articleId);

    List<CommentVO> listByArticleIdTime(Long articleId);

    int updateReplyByCommentId(Long commentId);

    int display(String id);

    int hide(String id);

    int updateReplyNumByCommentId(@Param("commentId") Long commentId,@Param("reply") int reply);
}
